<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      position: relative;
      width: 100%;
      height: 300px;
      border: 1px solid skyblue;
    }

    .img {
      position: absolute;
      width: 200px;
      height: 200px;
      animation: move 4s linear 1s infinite alternate;
    }

    .box:hover .img {
      animation-play-state: paused;
    }

    @keyframes move {
      0% {
        left: 0
      }

      100% {
        left: 100%;
      }
    }
  </style>
</head>

<body>
  <div class="box">
    <img class="img" src="./img/car.jpg" alt="">
  </div>
</body>

</html>